import { appSchema, tableSchema } from '@nozbe/watermelondb'

export default appSchema({
  version: 1,
  tables: [
    // We'll add tableSchemas here later
    tableSchema({
        name: 'posts',
        columns: [
          { name: 'title', type: 'string' },
          { name: 'last_event_at', type: 'string', isOptional: true },
          { name: 'subtitle', type: 'string', isOptional: true },
          { name: 'body', type: 'string' },
          { name: 'is_pinned', type: 'boolean' },
        ]
      }),
      tableSchema({
        name: 'comments',
        columns: [
          { name: 'body', type: 'string' },
          { name: 'post_id', type: 'string', isIndexed: true },
        ]
      }),
    ]
})